<template>
	<view class="page_content">
		<view class="wrap">
			<image class="logo" :src="urlDomain+'crmebimage/presets/logo_new.png'"></image>
			<view class="title">购物免费进入公排回馈</view>
			<view class="tip">付款金额</view>
			<view class="input">
				<view>￥</view>
				<input :value="money" type="number" placeholder="请输入付款金额" class="amount" adjust-position="false"/>
			</view>
			<button class="btn" @click="goToPay">确认支付</button>
		</view>
	</view>
</template>

<script>
	import {orderPay} from '@/api/order.js';
	import {
		toLogin
	} from '@/libs/login.js';
	import {
		mapGetters
	} from "vuex";
	export default {
		computed: mapGetters(['isLogin']),
		data() {
			return {
				urlDomain: this.$Cache.get("imgHost"),
				martId: '',
				money: 0
			}
		},
		computed: {},
		onLoad(options) {
			const q = decodeURIComponent(options.q);
			let str = q.split('?')[1];
			this.martId = str.split("martId=")[1];
		},
		onShow() {
			if (!this.isLogin) {
				this.openAuto();
			}
		},
		methods: {
			goToPay() {
				uni.navigateToMiniProgram({
					appId: "wx387c3bf17023655f",
					path: "https://www.gzriyegou.com/pay/rygmall",
					success(res) {
						console.log("跳转成功",res);
					},
					fail(res) {
						console.log("跳转失败",res);
					}
				})
			},
			// 打开授权
			openAuto() {
				Cache.set(BACK_URL, '');
				toLogin();
			},
		}
	}
</script>

 
<style lang="scss" scoped>
	.wrap{
		margin-top: 140rpx;
		text-align: center;
		color: #343643;
		
		.logo{
			width: 316rpx;
			height: 164rpx;
		}
		
		.title{
			color: #555555;
			font-size: 26rpx;
		}
		
		.tip{
			font-size: 28rpx;
			text-align: left;
			padding-left: 62rpx;
			margin-top: 82rpx;
			margin-bottom: 46rpx;
		}
		
		.input{
			margin: 0 62rpx;
			font-size: 50rpx;
			font-weight: 600;
			display: flex;
			justify-content: center;
			border-bottom: 2rpx rgba(0,0,0,0.1) solid;
			align-items: center;
		}
		
		.amount{
			height: 90rpx;
			border: none;
			font-weight: 600;
			outline: none;
			text-align: left;
		}
		
		.btn{
			background-color: #4484FF;
			color: #fff;
			font-size: 28rpx;
			border-radius: 16rpx;
			height: 88rpx;
			line-height: 88rpx;
			margin: 60rpx 32rpx 0 32rpx;
		}
	}
		
</style>
